

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}


server {
    
    listen 443 ssl;
    server_name rtc.technologycloud.net;


    ssl_certificate   /opt/andrew_git/openresty_controller/cert/5846579_rtc.technologycloud.net.pem;
    ssl_certificate_key  /opt/andrew_git/openresty_controller/cert/5846579_rtc.technologycloud.net.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    lua_code_cache on;

    gzip on;

    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    

    location / {
         add_header 'Access‐Control‐Allow‐Origin' '*';
         add_header 'Access‐Control‐Allow‐Credentials' 'true';
         add_header 'Access‐Control‐Allow‐Methods' '*';
         add_header 'Access‐Control‐Allow‐Headers' 'Origin, X‐Requested‐With, Content‐Type,Accept';
         proxy_pass http://106.14.58.100:3016/dist/;
    }

    location /socket.io/ {
        proxy_pass http://106.14.58.100:3016/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

    location /andrew_git/ {
        alias /opt/andrew_git/;
        index index.html;
    }
        

    location /opt/ {
        alias /opt/;
        index index.html;
    }


}
